/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */

package software.amazon.awssdk.enhanced.dynamodb.functionaltests.models;

import static software.amazon.awssdk.enhanced.dynamodb.mapper.UpdateBehavior.WRITE_IF_NOT_EXISTS;

import java.time.Instant;
import software.amazon.awssdk.enhanced.dynamodb.extensions.annotations.DynamoDbAtomicCounter;
import software.amazon.awssdk.enhanced.dynamodb.extensions.annotations.DynamoDbAutoGeneratedTimestampAttribute;
import software.amazon.awssdk.enhanced.dynamodb.extensions.annotations.DynamoDbVersionAttribute;
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbPartitionKey;
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbUpdateBehavior;

@DynamoDbBean
public class NestedRecordWithUpdateBehavior {
    private String id;
    private String nestedUpdateBehaviorAttribute;
    private Long nestedVersionedAttribute;
    private Instant nestedTimeAttribute;
    private Long nestedCounter;
    private NestedRecordWithUpdateBehavior nestedRecord;
    private String attribute;

    @DynamoDbPartitionKey
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @DynamoDbUpdateBehavior(WRITE_IF_NOT_EXISTS)
    public String getNestedUpdateBehaviorAttribute() {
        return nestedUpdateBehaviorAttribute;
    }

    public void setNestedUpdateBehaviorAttribute(String nestedUpdateBehaviorAttribute) {
        this.nestedUpdateBehaviorAttribute = nestedUpdateBehaviorAttribute;
    }

    @DynamoDbVersionAttribute
    public Long getNestedVersionedAttribute() {
        return nestedVersionedAttribute;
    }

    public void setNestedVersionedAttribute(Long nestedVersionedAttribute) {
        this.nestedVersionedAttribute = nestedVersionedAttribute;
    }

    @DynamoDbAutoGeneratedTimestampAttribute
    public Instant getNestedTimeAttribute() {
        return nestedTimeAttribute;
    }

    public void setNestedTimeAttribute(Instant nestedTimeAttribute) {
        this.nestedTimeAttribute = nestedTimeAttribute;
    }

    @DynamoDbAtomicCounter
    public Long getNestedCounter() {
        return nestedCounter;
    }

    public void setNestedCounter(Long nestedCounter) {
        this.nestedCounter = nestedCounter;
    }

    public NestedRecordWithUpdateBehavior getNestedRecord() {
        return nestedRecord;
    }

    public void setNestedRecord(NestedRecordWithUpdateBehavior nestedRecord) {
        this.nestedRecord = nestedRecord;
    }

    public String getAttribute() {
        return attribute;
    }

    public void setAttribute(String attribute) {
        this.attribute = attribute;
    }
}
